using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace QFramework.PaokuDemo
{
    public class FollowPlayer : MonoBehaviour
    {
        Transform m_player;
        Vector3 m_offset;
        float speed = 20;

        private void Start()
        {
            m_player = GameObject.FindWithTag(Tag.player).transform;
            Debug.LogError(m_player.name);
            m_offset = transform.position - m_player.position;
        }

        private void Update()
        {
            transform.position = Vector3.Lerp(transform.position, m_offset + m_player.position, speed * Time.deltaTime);
        }
    }
}
